package com.d0317hw;
import java.util.Arrays;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        int[] a = new int[5];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入5个整数：");
        for(int i = 0; i < 5 ; i++) {
            a[i] = sc.nextInt();
        }
        System.out.println("逆序输出为：");

        for(int j = 4; j >=0; j--) {   // 逆序输出
            System.out.print(a[j]+" ");
        }
        //System.out.println(" ");
        Arrays.sort(a);
        System.out.println("从小到大排序：");

        for(int i=0;i<a.length;i++)
            System.out.print(a[i]+" ");

    }
}
